import request from '@/utils/request'
import { GEN_SERVER } from '@/config/baseUrl'

// 查询班次信息列表
export function listClasses(data) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/classes/list',
    method: 'post',
    data: data
  })
}

// 查询班次信息详细
export function getClasses(id) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/classes/detail',
    method: 'get',
    params: {
      id
    }
  })
}

// 新增/修改班次信息
export function addOrUpdateClasses(data) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/classes/addOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除班次信息
export function delClasses(id) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/classes/deleteByIds',
    method: 'post',
    params: {
      ids: id
    }
  })
}

// 根据id获取已有班组关联的班次类型编码
export function getClassesWithGroups(ids) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/classes/getClassesWithGroups',
    method: 'get',
    params: {
      ids
    }
  })
}

// 导出班次信息
export function exportClasses(query) {
  return request({
    url: GEN_SERVER['produce-server'] + '/data/classes/export',
    method: 'post',
    data: query
  })
}
